<template>
	<view class="content">
		<view>
			<web-view :src="websrc"></web-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				websrc: '',
				appUrl: '/hybrid/html/readPdf/index/index.html', //app内的web地址
				webUrl: 'https://www.您的网站/readPdf/index/index.html', //远程web地址
				pdfUrl: '',
				title: '', //pdf文件名称
			}
		},
		onLoad(option) {
			console.log(option);
			// let file = decodeURIComponent(option).params;
			// console.log(file);
			// console.log(JSON.parse(file));
			//app 直接跳转到app内的web页面
			//#ifdef APP-PLUS
			this.websrc = this.appUrl + '?url=' + option.url + '&tname=' + option.title;
			console.log(this.websrc);
			//#endif

			//微信小程序跳转到https web页面
			//#ifdef MP-WEIXIN
			this.websrc = this.webUrl + '?url=' + encodeURIComponent(this.pdfUrl) + '&tname=' + encodeURIComponent(this
				.title)
			//#endif

		},
	}
</script>

<style>
</style>
